import request from '@/utils/request'

export function getVerifyCode(email) {
  return request({
    url: '/auth/user/code',
    method: 'post',
    data: { email }
  })
}

export function login(data) {
  return request({
    url: '/auth/user/doLogin',
    method: 'post',
    data
  })
}

export function registerUser(email) {
  return request({
    url: '/auth/user/register',
    method: 'post',
    data: { email }
  })
}

export function getUserInfo() {
  return request({
    url: '/auth/userInfo/info',
    method: 'get'
  })
}

export function getIpAddress(ip) {
  return request({
    url: '/auth/user/ipAddress',
    method: 'get',
    params: { ip }
  })
}

export function getRankList() {
  return request({
    url: '/article/rank',
    method: 'get'
  })
}

export function sign() {
  return request({
    url: '/article/point/sign',
    method: 'get'
  })
}

export function chat(userId,message,sendId) {
  return request({
    url: '/socket/chat/send',
    method: 'get',
    params: {userId,message,sendId}
  })
}

export function online() {
  return request({
    url: '/socket/chat/list',
    method: 'get',
  })
}

export function getUserDetail() {
  return request({
    url: '/article/user/info',
    method: 'get',
  })
}

export function listFollow() {
  return request({
    url: '/article/follow/listFollow',
    method: 'get',
  })
}

export function listConcern() {
  return request({
    url: '/article/follow/listConcern',
    method: 'get',
  })
}

export function listFriend() {
  return request({
    url: '/article/follow/listFriend',
    method: 'get',
  })
}

export function jx(url) {
  return request({
    url: '/auth/user/jx',
    method: 'get',
    params: { url }
  })
}

export function ai(question) {
  return request({
    url: '/auth/chat',
    method: 'get',
    params: { question }
  })
}

export function aiStream(question) {
  return request({
    url: '/auth/chatStream',
    method: 'get',
    params: { question }
  })
}

export function getById(id) {
  return request({
    url: '/auth/user/getById',
    method: 'get',
    params: { id }
  })
}